#include "TestClass.h"
#include "OOPObjectTest.h"
#include "OOPPtrTest.h"
#include "ConfigTest.h"
#include <process.h>
HANDLE hMutex;
void _cdecl test (void *);

int main (int argc, char ** argv)
{
	hMutex = CreateMutex (NULL, FALSE, NULL);
	const int threadNum = 1000;
	HANDLE hThreads[threadNum];
	for (int i = 0; i < threadNum; ++i) {
		hThreads[i] = (HANDLE)_beginthread (test, 0, NULL);
	}
	WaitForMultipleObjects (threadNum, hThreads, TRUE, INFINITE);
	//ConfigTest ().test ();
	system ("pause");
	return 0;
}

void _cdecl test (void *) {
	OOPObjectTest ().test ();
	try {
		OOPPtrTest ().test ();
	} catch (...) {
		try {
			OOPPtrTest ().test ();
		} catch (...) {

		}
	}
}